package com.atguigu08.constructor.exer2;

/**
 * ClassName: TriAngle
 * Package: com.atguigu08.constructor.exer2
 * Description:
 *      编写两个类，TriAngle和TriAngleTest，其中TriAngle类中声明私有的底边长base和高height，
 *      同时声明公共方法访问私有变量。此外，提供类必要的构造器。另一个类中使用这些公共方法，计算三角形的面积。
 * @Author BuTang
 * @Create 2023/3/1 15:03
 * @Version 1.0
 */
public class TriAngle {
    private double base;
    private double height;
    public TriAngle(){

    }
    public TriAngle(double b,double h){
        base =b;
        height =h;
    }
    public void setBase(double d){
        base =d;
    }
    public double getBase(){
        return base;
    }
    public void setHeight(double h){
        height = h;
    }
    public double getHeight() {
        return height;
    }
    public double findSrea(){
        return base*height/2;
    }


}
